home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
COMMUNIC
/
MRUN211.ZIP
/
MRUN211.WAS
< prev
next >
Wrap
Text File
|
1993-05-01
|
34KB
|
1,042 lines
;MailRun v2.11: Automated BBS Communications
;1992-1993 Gerald P. Sully, all rights reserved.
#comment
**************************************************************************
**************************************************************************
*
* The source code for MailRun is contained in 9 separate files:
* MRUN211.WAS (this file), MRUN211.H (a header file), and files
* named MRUN211?.WAS, where ? is a letter A through G. MailRun
* also requires the file MRUNICON.DLL in order to display the
* tool bar.
*
* MRUN211.WAS is the script from which the other script files
* are run. It performs a brief initialization to find the
* location of its support files, then chains to MRUN211A.WAS,
* which is the principle engine of MailRun. It will also
* perform an install routine if it finds that there is no
* current MAILRUN.INI file.
*
* The key files of MailRun are the *.MRN files. These
* store configuration information and control what tasks
* will be performed on each BBS. The user interface is
* designed to provide a convenient way to edit these files
* and display their contents. The files are standard INI
* files, and so may also be edited by hand. The comm engine,
* contained in MRUN211G.WAS, reads the currently loaded *.MRN
* file, calls each BBS and executes each pending task.
*
**************************************************************************
**************************************************************************
#endcomment
#define IniFile 0
string MailRunIni, MailRunList, MailRunTrunc, MailRun, OldIni
string MailRunDir, MailDir, ReplyDir, DownloadDir, UploadDir, TempDir
string DialAttempts, DialTimeout, DialPause, IdleTimeout, SavePackets
string Archiver, QWKReader, LogViewer
integer LogRun, AppendLog, AnsiInLog, NewfileFilter, HelpPage
float Version
#comment
*********************************************************************
*
* MAIN()
*
* Calls makefullname(), checkdir(), makeini(), gettempdir(),
* delspec(), changesettings(), movedir(), updatemrn()
*
* Executes MRUN211A.WAX
*
* Checks for existence of MAILRUN.INI file, then chains
* to the main body of the script.
*
*********************************************************************
#endcomment
proc main
string MRunMain, temp, MailRunHelp
MailRunHelp = makefullname($PWTASKPATH, "mailrun.hlp")
if isfile MailRunHelp
set aspect helpfile "mailrun.hlp"
endif
;Create the temporary directory
gettempdir()
if !(checkdir(TempDir, ""))
halt
endif
MailRunIni = makefullname($WINPATH, "MAILRUN.INI")
profilerd MailRunIni "MailRun" "Version" temp
atof temp Version
if Version != 2.11
;if there is no .INI file for version 2.11, run install procedure
fetch aspect scriptpath temp
temp = makefullname(temp, "mailrun.hlp")
if not strcmpi MailRunHelp temp
copyfile temp MailRunHelp
delfile temp
endif
set aspect helpfile "mailrun.hlp"
makeini()
changesettings()
movedir()
if Version != 2.10
updatemrn()
endif
delfile OldIni
statmsg "Installation complete!"
endif
;Make sure the Temp directory is empty
delspec(TempDir, "*.*")
profilerd MailRunIni "MailRun" "MailRunDir" MailRunDir
MRunMain = makefullname(MailRunDir, "MRUN211A")
execute MRunMain
endproc
#comment
*********************************************************************
*
* DELSPEC()
*
* Called by main()
*
* Calls makefullname()
*
* Deletes specified filespec from specified directory.
*
*********************************************************************
#endcomment
proc delspec
strparm dirname, spec
string filename, filespec
FileSpec = makefullname(dirname, spec)
findfirst FileSpec
while FOUND
FileName = makefullname(dirname, $FILENAME)
delfile FileName
findnext
endwhile
endproc
#comment
*********************************************************************
*
* MAKEINI()
*
* Called by main()
*
* Calls welcomebox(), getbbstypes()
*
* Creates the MAILRUN.INI file and sets default values.
*
*********************************************************************
#endcomment
proc makeini
string StateDLPath, StateULPath, AspectDir, temp, MailRunBak
integer dialogstatus
integer StateWaitCnct, StateCallPause, StateMaxDial
welcomebox()
;Check whether user wishes to continue
while 1
dialogstatus = $DIALOG
switch dialogstatus
case 1
;user chose Cancel
halt
endcase
case 10
;user chose OK
exitwhile
endcase
endswitch
endwhile
;Save the old MAILRUN.INI file if it exists
if isfile MailRunIni
OldIni = makefullname(TempDir, "oldini.tmp")
copyfile MailRunIni OldIni
MailRunBak = makefullname($WINPATH, "MAILRUN.BAK")
if isfile MailRunBak
delfile MailRunBak
endif
rename MailRunIni MailRunBak
endif
;Create the file MAILRUN.INI
fopen IniFile MailRunIni CREATE TEXT
if FAILURE
errormsg "Unable to create MAILRUN.INI;`r`nscript aborted...."
halt
endif
fputs IniFile "[MailRun]"
fputs IniFile "Version=2.11"
fputs IniFile "MailRun="
fputs IniFile "MailRunDir="
fputs IniFile "MailDir="
fputs IniFile "ReplyDir="
fputs IniFile "DownloadDir="
fputs IniFile "UploadDir="
fputs IniFile "DialAttempts="
fputs IniFile "DialTimeout="
fputs IniFile "DialPause="
fputs IniFile "IdleTimeout="
fputs IniFile "SavePackets="
fputs IniFile "LogRun="
fputs IniFile "AppendLog="
fputs IniFile "AnsiInLog="
fputs IniFile "NewfileFilter="
fputs IniFile "Archiver="
fputs IniFile "QWKReader="
fputs IniFile "LogViewer="
fputs IniFile "DLSortField=0"
fputs IniFile "ULSortField=0"
fputs IniFile "DLPurgeLimit=0"
fputs IniFile "ExecTime=HH:MM:SS"
fputs IniFile "AutoRun=0"
fputs IniFile "GoWait=1"
fputs IniFile "PostRun=1"
fputs IniFile "RingInterrupt=1"
fputs IniFile ""
fputs IniFile "[BBSTypes]"
fputs IniFile "BBSType_1=PCBoard 14.5"
fputs IniFile "BBSType_2=PCBoard 15.0"
fputs IniFile "BBSType_3=WildCat! 3.6"
fputs IniFile "BBSType_4=Auntie"
fputs IniFile "BBSType_5=RBBS"
fputs IniFile ""
fputs IniFile "[MailDoors]"
fputs IniFile "MailDoor_1=QMail"
fputs IniFile "MailDoor_2=MarkMail"
fputs IniFile "MailDoor_3=Cam-Mail"
fputs IniFile "MailDoor_4=RoseMail"
fputs IniFile "MailDoor_5=TomCat"
fputs IniFile "MailDoor_6=Auntie Mail"
fputs IniFile "MailDoor_7=KingMail"
fputs IniFile "MailDoor_8=Mail Manager"
fputs IniFile ""
fputs IniFile "[DEFAULT]"
fputs IniFile "BBSName="
fputs IniFile "BBSType=PCBoard 14.5"
fputs IniFile "MailDoorType=KingMail"
fputs IniFile "Number_1="
fputs IniFile "Number_2="
fputs IniFile "Number_3="
fputs IniFile "UserName="
fputs IniFile "PWord="
fputs IniFile "UserResp1="
fputs IniFile "UserResp2="
fputs IniFile "XferProt=ZModem"
fputs IniFile "MailXferProt=ZModem"
fputs IniFile "QWKArchiver=pkunzip.exe"
fputs IniFile "LangNumber="
fputs IniFile "GraphicsOn=1"
fputs IniFile "LangPrompt=Language"
fputs IniFile "GraphicsPrompt=graphics (Enter)"
fputs IniFile "NamePrompt=first name"
fputs IniFile "PWordPrompt=Password"
fputs IniFile "UserPrompt1="
fputs IniFile "UserPrompt2="
fputs IniFile "ScanPrompt=Last Read"
fputs IniFile "ViewPrompt=View"
fputs IniFile "MorePrompt=More?"
fputs IniFile "FilePrompt="
fputs IniFile "ContinuePrompt=Continue"
fputs IniFile "CommandPrompt=Command?"
fputs IniFile "DLPrompt=Aborts Transfer"
fputs IniFile "DLUnavPrompt=(Enter)=none"
fputs IniFile "ULPrompt=Aborts Transfer"
fputs IniFile "ULDescPrompt=? ("
fputs IniFile "MsgMenuPrompt="
fputs IniFile "MailDoor=KM"
fputs IniFile "MailPrompt=KingMail Command"
fputs IniFile "ReceiveQWKPrompt=When Done"
fputs IniFile "MailDLPrompt=Aborts Transfer"
f